<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/24 0024
 * Time: 17:22
 */
//ini_set('include_path', '/var/log:./bin');
ini_set('include_path', './bin');
$url = 'compress.bzip2://logfile.bz2';
$fil = 'compress.zlib://fool.gz';
$fr = fopen($url, 'rb', true);
$fw = fopen($fil, 'wb1');

if (is_resource($fr) and is_resource($fw)) {
    while (!feof($fr)) {
        $data = fread($fr, 1024);
        fwrite($fw, $data);
    }
    fclose($fr);
    fclose($fw);
}